package HomeWork;

public class SnakeToCamel {
    /**
     * 蛇形转驼峰
     * @param s
     * @return
     */
    private static String snakeToCamel(String s)
    {
        String separator = "_";
        String under="";
        s = s.toLowerCase().replace(separator, " ");
        String sarr[]=s.split(" ");
        for(int i=0;i<sarr.length;i++)
        {
            String w=sarr[i].substring(0,1).toUpperCase()+sarr[i].substring(1);
            under +=w;
        }
        return under;
    }

    public static void main(String[] args) {
        System.out.println(SnakeToCamel.snakeToCamel("my_name"));
    }
}
